﻿using System;
using System.Collections.Generic;
using Commands.Logging;
using Commands.Scheduling;

namespace Commands
{
    internal interface ICommandManager
    {
        /// <summary>
        /// Fired when GetAndExecute task finished.
        /// </summary>
        event Action<TaskMessage, IEnumerable<Command>> TaskFinished;

        /// <summary>
        /// Check e-mail for commands, then execute them.
        /// </summary>
        /// <param name="shouldExecuteForAllLetters">Should we get commands from all new letters.
        /// If 'false' only commands from most newer letter will be executed.</param>
        /// <returns>'True' if commands was received.</returns>
        bool GetAndExecute();

        /// <summary>
        /// Schedule for checking and suspending.
        /// </summary>
        ISchedule Schedule
        {
            get;
        }

        Log Log
        {
            get;
        }
    }
}
